app.controller("z-notice-c", [ '$scope','$rootScope','$z-http','$sce','z-notice-s','$filter',
		function($scope,$rootScope,$zhttp,$sce,Service,$filter) {
		$scope.viewModel = {};

		//加载数据
		$scope.viewModel.bindData = function(){
			$scope.viewModel.isLoading=true;
			//获取基本信息
			Service.getAnnouncementListByExpireDate(
			function(data){
				$scope.viewModel.announcementList=data;
				$scope.viewModel.isLoading=false;
			},function(error) {
				$scope.viewModel.isLoading=false;
			});
		};
		$scope.viewModel.bindData();
		
		// 格式化HTML
		$scope.viewModel.trustAsHtml = function(html) {
		    return $sce.trustAsHtml(html);
		};
		
		// 下载
		$scope.viewModel.download = function (url,fileName) {
			const ele = document.createElement('a');
		    ele.setAttribute('href',url); //设置下载文件的url地址
		    ele.setAttribute('download',fileName);//用于设置下载文件的文件名
		    ele.click();
		};
} ]);